<?php
/**
 * This is the base CMS item form.
 */
class DigCms_Form_Item extends Dig_Form_Abstract 
{
    /**
     * Creates the standard item form
     *
     * This form contains a hidden id field, a field for the name and the submit buttons.
     * It also sets the form class to ajaxForm, so the CMS can process it with AJAX
     * 
     * @param array $options
     */
    public function __construct($options = array())
    {
        parent::__construct($options);
        
        $this->setAttrib('class', 'ajaxForm');
        $this->addElement('hidden', 'id');

        $name = $this->addElement('text', 'name', array(
            'label'	    => 'Item Name',
            'required'	=> false,
            'order'		=> 0,
            'filters'   => array(
                new Zend_Filter_StringToLower(),
                new Zend_Filter_Word_SeparatorToSeparator('-', ' '),
                new Zend_Filter_Word_SeparatorToSeparator('  ', ' '),
                new Zend_Filter_Word_SeparatorToSeparator(' ', '_'),
                new Zend_Filter_Word_SeparatorToSeparator('__', '_'),
            )
        ));


        $this->addElement('textarea', 'admin_notes', array(
            'label'	    => 'Administrator Notes',
            'class'	    => 'small',
            'order'     => 9000
        ));
        
        $submit = $this->addElement('submit', 'save', array('label' => 'Save', 'decorators' => array('ViewHelper')));
        $submit = $this->addElement('submit', 'cancel', array('label' => 'Cancel', 'decorators' => array('ViewHelper')));
        $this->addDisplayGroup(array('save', 'cancel'), 'submit_buttons', array('order' => 10000));
    }
    
}
?>